package cn.wolfcode.trip.base.service.impl;
import cn.wolfcode.trip.base.domain.SystemInfo;
import cn.wolfcode.trip.base.mapper.SystemInfoMapper;
import cn.wolfcode.trip.base.query.SystemInfoQueryObject;
import cn.wolfcode.trip.base.service.ISystemInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;


@Service
public class SystemInfoImpl implements ISystemInfoService {
    @Autowired
    private SystemInfoMapper systemInfoMapper;

    @Override
    public PageInfo<SystemInfo> query(SystemInfoQueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(),qo.getPageSize(),true,false,true);
        List<SystemInfo> list = systemInfoMapper.selectByUserId(qo);
        return new PageInfo<>(list);
    }
    @Override
    public Integer selectStateByUserId(SystemInfoQueryObject qo) {
        return systemInfoMapper.selectStateByUserId(qo);
    }

    @Override
    public void updateStateByUserId(Long userId) {
        systemInfoMapper.updateStateByUserId(userId);
    }


}
